﻿using furion.blog.Domain.Query.User;
using furion.blog.Domain.Shared;
using furion.blog.Domain.Shared.Dto.User;
using furion.blog.Domain.Shared.Vo.Menu;
using furion.blog.Domain.Shared.Vo.User;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace furion.blog.Application.Contracts
{
    public interface IUserService
    {
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<UserLoginSuccessVO> Login(UserLoginDto dto);

        /// <summary>
        /// 当前登录账号信息
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<CurrentLoginUserInfoVO> CurrentLoginUserInfo(long userId);

        /// <summary>
        /// 当前账号拥有菜单
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<List<DashboardMenuVO>> CurrentUserMenus(long userId);

        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task ChangePassword(UserChangePasswordDto dto);

        /// <summary>
        /// 账号档案
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<UserProfileVO> Profile(long userId);

        /// <summary>
        /// 更新账号档案
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task UpdateProfile(UserProfileUpdateDto dto);

        /// <summary>
        /// 分页
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        Task<PageVO> List(UserListQuery query);

        /// <summary>
        /// 修改状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="status"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task ChangeStatus(long id,string status,long userId);

        /// <summary>
        /// 删除账号
        /// </summary>
        /// <param name="id"></param>
        /// <param name="userId">操作人id</param>
        /// <returns></returns>
        Task Delete(long id,long userId);

        /// <summary>
        /// 恢复原始密码
        /// </summary>
        /// <param name="id"></param>
        /// <param name="userId">操作人id</param>
        /// <returns></returns>
        Task PasswordRecover(long id,long userId);


        /// <summary>
        /// 账号详细信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<UserDetailVO> Detail(long id);

        /// <summary>
        /// 新增账号
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task Add(UserCreateDto dto);

        /// <summary>
        /// 更新账号信息
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task Update(UserUpdateDto dto);

        /// <summary>
        /// 统计
        /// </summary>
        /// <param name="exp"></param>
        /// <returns></returns>
        Task<long> Count(UserDetailQuery query);

    }
}
